package study;

public class copyOfRange {
    public static void main(String[] args){
        int[] arr = {1 , 2 , 3 , 4 , 5 , 6};
        int[] arr1 = copy(arr , 1 ,5);
        for(int i = 0;i < arr1.length;i++){
            System.out.println(arr1[i]);
        }
    }

    public static int[] copy(int[] arr , int left , int right){
        int len = right - left;
        int[] arr1 = new int[len];
        for(int i = 0;i < len;i++){
            arr1[i] = arr[i + left];
        }
        return arr1;
    }
}
